package com.jiuqi.common;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2002</p>
 * <p>Company: </p>
 * @author
 * @version 1.0
 */

public class OrderGenerator {
  private static long maxorder = System.currentTimeMillis();
  private static Object o = new Object();
  private static final String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  public static String newOrder(){
    long l;
    synchronized(o){
      maxorder++;
      l=maxorder;
    }
    StringBuffer rt = new StringBuffer(10);
    while(l>0){
      rt.insert(0, chars.charAt((int)(l%36)));
      l = l/36;
    }
    return rt.toString();
  }

  public static void main(String[] args){
    for(int i=0; i<100; i++)
    System.out.println(OrderGenerator.newOrder());
  }
}